<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePublishContentTemplateHistorysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('publish_content_template_historys', function (Blueprint $table) {
            $table->increments('id');
            $table->string('batch_no')->nullable();
            $table->string('task_no')->nullable();
            $table->integer('done_count')->unsigned()->default(0);
            $table->integer('error_count')->unsigned()->default(0);
            $table->integer('success_count')->unsigned()->default(0);
            $table->integer('count')->unsigned()->default(0);
            $table->float('consuming_time', 8, 2)->default(0);
            $table->float('used_memory', 8, 2)->default(0);
            $table->text('content')->nullable();
            $table->integer('user_id')->unsigned()->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('publish_content_template_historys');
    }
}
